An important aspect of most methods for compressing sequences of digital video images is motion analysis. In typical motion analysis, a target image in a sequence of images is divided into a plurality of blocks of pixels. A target region that includes at least one pixel block is selected from the target image. The image preceding the target image is analyzed pixel by pixel in order to locate a region of the preceding image that closely matches the target region of the target image. Block matching techniques based on mean-square-error or mean-absolute-error are typically used to locate the region of the preceding image that closely matches the target region of the target image. If no motion has occurred, the preceding and target regions will have the same coordinates within the image frame. If motion has occurred, the preceding region will be offset or translated relative to the target region by an amount that is represented by a displacement vector. This process is typically repeated for each target region in the target image, thereby yielding a displacement vector for each target region. These displacement vectors are thereafter applied to a previous reconstructed image to form a predicted image. An error image is formed from the difference (residual errors) between the target image and the predicted image. The displacement vectors and the residual error image are then encoded for subsequent use by a decoder in decoding the compressed digital video signal.
However, current compression/decompression processes are difficult to implement efficiently in a resource-constrained or browser-based client. For example, with a browser based client executing JavaScript™ (“JavaScript”), current compression/decompression processes are difficult to implement efficiently because JavaScript is too slow to operate on individual pixels at high resolution with high frame rates. Further, a HyperText Markup Language (HTML) canvas does not provide a mechanism to add a residual error image to the canvas.